<template>
	<view class="index-page with-tabbar">
		<view class="page-content ">
			<!-- 个人信息 -->
			<div>南京薪岗通科技有限公司致力打造全方位的综合性企业共享服务生态平台!</div>
			<div>企业身边的服务管家，为企业提供人力资源、财税服务、法务服务、创业孵化、融资服务、技能培训、灵活用工等全方位、多层次、综合性、高效率的一站式解决方案,致力于企业调整发展的服务平台。</div>
			<div>你身边的职场教练，为你提供找工作、简历优化、面试辅导、职业规划、职场陪伴及创业服务。</div>
			<div class="“mt-20">
				<div>邮箱:xgt319@yijiangongxiang.com</div>
				<div>地址:江苏省南京市玄武区红山南路51号红山创智天地</div>
			</div>


		</view>
	</view>
</template>

<script>
export default {

	data() {
		return {
			baseUrl: getApp().globalData.baseUrl,

		};
	},
	computed: {
		userInfo() {
			return this.$store.getters.userInfo || {};
		},
	},
	async onLoad() {
		this.postForm = this.userInfo
	},
	async onShow() {
		// await this.getUserInfo()
	},
	mounted() {

	},
	methods: {
		toSet(url) {
			uni.navigateTo({
				url
			})
		},
		async getUserInfo() {
			const {
				data
			} = await getUserInfoApi({})
			this.postForm = data;
		},
		submit() {
			let params = {
				userHeaderUrl: this.postForm.userHeaderUrl,
				userName: this.postForm.userName,
				selfIntroduction: this.postForm.selfIntroduction,
				age: this.postForm.age,
				position: this.postForm.position,
				gender: this.postForm.gender
			}
			uni.showLoading({
				mask: true,
			});
			editUser(params).then((res) => {
				uni.hideLoading();
				uni.showToast({
					title: "修改成功",
					icon: "success",
				});
				getApp().globalData.mineTitleRefresh = true
				// this.$store.dispatch("getUserInfo");
				setTimeout(() => {
					uni.navigateBack({});
				}, 1000);
			});
		},

		ageChange(e) {

			let index = e.detail.value;

			this.postForm.age = this.ages[index];
			console.log(this.postForm)
		},

		cityChange(e) {
			console.log(e);
			this.postForm.province = e.detail.value[0];
			this.postForm.city = e.detail.value[1];

			if (
				this.postForm.province.indexOf("北京") >= 0 ||
				this.postForm.province.indexOf("天津") >= 0 ||
				this.postForm.province.indexOf("上海") >= 0 ||
				this.postForm.province.indexOf("重庆") >= 0
			) {
				this.postForm.position =
					e.detail.value[1].replace("市", "") +
					" " +
					e.detail.value[2].replace("区", "");
			} else {
				this.postForm.position =
					e.detail.value[0].replace("省", "") +
					" " +
					e.detail.value[1].replace("市", "");
			}
		},

		sexChange(v) {
			console.log(v.detail.value)
			this.postForm.gender = v.detail.value;
		},

		upload() {
			var _this = this
			uni.chooseImage({
				count: 1,
				sourceType: ["album", "camera"],
				sizeType: ["original"], //compressed可以指定是原图还是压缩图，默认二者都有
				success: async (res) => {
					console.log(res.tempFilePaths[0])
					// uni.showLoading({
					// 	title: '图片上传中',
					// 	icon: 'loading'
					// })
					let form = encodeURIComponent(JSON.stringify(_this.postForm))
					uni.navigateTo({
						url: '/pages/mine/uploadImg?imgUrl=' + res.tempFilePaths[0] + '&postForm=' + form
					})
				},
				fail: () => {
					//处理如果没选择任何图片
					console.log("unChooseAnyimg");
					this.$emit("unChooseAnyimg");
				},
			});
		},
	},
};
</script>

<style lang="less" scoped>
.page-content {
	padding: 30upx;
	background: #fff;

	div {
		line-height: 40upx;
		font-size: 28upx;
	}
}
</style>
